package com.nbsaas.sample.user.rest.convert;

import com.nbsaas.sample.entity.user.UserRole;
import com.nbsaas.sample.user.api.domain.simple.UserRoleSimple;

import com.nbsaas.boot.rest.api.Converter;
/**
* 列表对象转换器
*/

public class UserRoleSimpleConvert implements Converter<UserRoleSimple, UserRole> {




    @Override
    public UserRoleSimple convert(UserRole source) {
        UserRoleSimple result = new UserRoleSimple();

                    result.setAlias(source.getAlias());
                    if(source.getCatalog()!=null){
                    result.setCatalogName(source.getCatalog().getName());
                    }
                    result.setLastDate(source.getLastDate());
                    result.setType(source.getType());
                    result.setId(source.getId());
                    if(source.getCatalog()!=null){
                    result.setCatalog(source.getCatalog().getId());
                    }
                    result.setAddDate(source.getAddDate());
                    result.setName(source.getName());
                    result.setDescription(source.getDescription());


    return result;
  }

}